{{! -------------------------------------------------------------------------- }}
{{! Copyright 2002-2016, OpenNebula Project, OpenNebula Systems                }}
{{!                                                                            }}
{{! Licensed under the Apache License, Version 2.0 (the "License"); you may    }}
{{! not use this file except in compliance with the License. You may obtain    }}
{{! a copy of the License at                                                   }}
{{!                                                                            }}
{{! http://www.apache.org/licenses/LICENSE-2.0                                 }}
{{!                                                                            }}
{{! Unless required by applicable law or agreed to in writing, software        }}
{{! distributed under the License is distributed on an "AS IS" BASIS,          }}
{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   }}
{{! See the License for the specific language governing permissions and        }}
{{! limitations under the License.                                             }}
{{! -------------------------------------------------------------------------- }}
<div class="row hypervisor only_vcenter" hidden>
  <div class="large-12 columns text-center">
    <label>{{tr "Contextualization type"}}</label>
    <input type="radio" name="context_type" id="context_type_vcenter" value="context_type_vcenter">
    <label for="context_type_vcenter">{{tr "vCenter"}}</label>
    <input type="radio" name="context_type" id="context_type_opennebula" value="context_type_opennebula">
    <label for="context_type_opennebula">{{tr "OpenNebula"}}</label>
  </div>
  <hr/>
</div>
<div class="row hypervisor only_vcenter context_type context_type_vcenter" hidden>
  <div class="columns medium-6">
    <label>
      {{tr "vCenter customizations"}}
      <select class="vcenter_customizations"/>
    </label>
  </div>
  <div class="columns medium-6">
    <label>&nbsp;</label>
    <input class="vcenter_customizations_value" type="text">
  </div>
</div>
<div class="context_type context_type_opennebula row collapse">
  <div class="medium-2 columns">
    <ul id="context_tabs" class="tabs vertical" data-tabs>
      <li class="tabs-title is-active">
        <a href="#netsshTab{{uniqueId}}">{{tr "Configuration"}}</a>
      </li>
      <li class="tabs-title">
        <a href="#filesTab{{uniqueId}}">{{tr "Files"}}</a>
      </li>
      <li class="tabs-title">
        <a href="#customTab{{uniqueId}}">{{tr "Custom vars"}}</a>
      </li>
    </ul>
  </div>
  <div class="medium-10 columns">
    <div class="tabs-content vertical" data-tabs-content="context_tabs">
      <div class="wizard_internal_tab is-active tabs-panel netsshTab" id="netsshTab{{uniqueId}}">
        <div class="row">
          <div class="columns medium-6">
            <div class="row">
              <div class="columns large-12">
                <input type="checkbox" class="ssh_context" id="ssh_context{{uniqueId}}" checked>
                <label for="ssh_context{{uniqueId}}">
                  {{tr "  Add SSH contextualization"}}
                {{{tip (tr "Add an ssh public key to the context. If the Public Key textarea is empty then the user variable SSH_PUBLIC_KEY will be used.")}}}
                </label>
              </div>
            </div>
            <div class="row">
              <div class="large-12 columns">
                <label>
                  {{tr "SSH public key"}}
                  <textarea rows="2" type="text" id="ssh_public_key" name="ssh_public_key" />
                </label>
              </div>
            </div>
          </div>
          <div class="columns medium-6">
            <div class="row">
              <div class="columns large-12">
                <input type="checkbox" class="network_context" id="network_context{{uniqueId}}" checked>
                <label for="network_context{{uniqueId}}">
                  {{tr "  Add Network contextualization"}}
                {{{tip (tr "Add network contextualization parameters. For each NIC defined in the NETWORK section, ETH$i_IP, ETH$i_NETWORK... parameters will be included in the CONTEXT section and will be available in the Virtual Machine")}}}
                </label>
              </div>
            </div>
            <div class="row">
              <div class="columns large-12">
                <input type="checkbox" class="token_context" id="token_context{{uniqueId}}">
                <label for="token_context{{uniqueId}}">
                  {{tr "  Add OneGate token"}}
                {{{tip (tr "Add a file (token.txt) to the context containing the token to push custom metrics to the VirtualMachine through OneGate")}}}
                </label>
              </div>
            </div>
            <div class="row">
              <div class="columns large-12">
                <input type="checkbox" class="report_ready_context" id="report_ready_context{{uniqueId}}">
                <label for="report_ready_context{{uniqueId}}">
                  {{tr "  Report Ready to OneGate"}}
                {{{tip (tr "Sends READY=YES to OneGate, useful for OneFlow")}}}
                </label>
              </div>
            </div>
          </div>
        </div>
        <div class="row">
          <div class="large-12 columns">
            <label>
              {{tr "Start script"}}
              {{{tip (tr "Text of the script executed when the machine starts up. It can contain shebang in case it is not shell script")}}}
              <textarea rows="4" type="text" class="START_SCRIPT monospace" placeholder="yum upgrade"/>
            </label>
            <input type="checkbox" class="ENCODE_START_SCRIPT" id="ENCODE_START_SCRIPT{{uniqueId}}">
            <label for="ENCODE_START_SCRIPT{{uniqueId}}">{{tr "Encode script in Base64"}}</label>
          </div>
        </div>
        <br/>
        <div class="large-12 columns vm_updateconf_hide">
          <fieldset class="row">
            <legend>
            <i class="fa fa-lg fa-fw fa-cogs off-color"/>{{tr "User Inputs"}}
            {{{tip (tr "These attributes must be provided by the user when a new VM is instantiated. They will be included in the VM context")}}}
            </legend>
            <div class="row">
              <div class="large-12 columns">{{{userInputsHTML}}}</div>
            </div>
          </fieldset>
        </div>
      </div>
      <div class="wizard_internal_tab tabs-panel filesTab" id="filesTab{{uniqueId}}">
        <div class="vm_updateconf_hide">
          {{{contextFilesTableHTML}}}
        </div>
        <div class="row vm_updateconf_hide">
          <div class="large-12 columns">
            <label>
              {{tr "FILES_DS"}}
              <input type="text" wizard_field="FILES_DS" class="FILES_DS" />
            </label>
          </div>
        </div>
        <div class="row">
          <div class="large-12 columns">
            <label>
              {{tr "Init scripts"}}
              {{{tip (tr "The contextualization package executes an init.sh file if it exists. If more than one script file is added, this list contains the scripts to run and their order")}}}
              <input type="text" wizard_field="INIT_SCRIPTS" class="INIT_SCRIPTS" placeholder="init.sh users.sh mysql.sh"/>
            </label>
          </div>
        </div>
      </div>
      <div class="wizard_internal_tab tabs-panel customTab" id="customTab{{uniqueId}}">{{{customTagsTableHTML}}}</div>
    </div>
  </div>
</div>
